<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
<c:set var="currentMenu" value="products" />
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="author" content="" />
<!-- Pragma content set to no-cache tells the browser not to cache the page
This may or may not work in IE -->
<meta http-equiv="Pragma" content="no-cache" />

<!-- Setting the page to expire at 0 means the page is immediately expired
Any vales less then one will set the page to expire some time in past and
not be cached. This may not work with Navigator -->
<meta http-equiv="expires" content="0" />


<title>JK Holdings</title>
<link rel="stylesheet" type="text/css" href="/css/style.css" media="screen" />
<script src="/js/jquery-1.6.4.js"></script>
<script>
	jQuery(function($) {
		$("#btnProductForm").click(function() {
			location.href="/products/form.do";
		});
	});
</script>
</head>

<body id="top">
	<!-- 공통 헤더 시작 -->
	<%@ include file="/WEB-INF/head.jsp"%>
	<!-- 공통 헤더 끝 -->

	<!-- 메인 네비게이션 시작  -->
	<%@ include file="/WEB-INF/navigation.jsp"%>
	<!-- 메인 네비게이션 끝  -->

	<div id="content-wrapper">
		<div class="center-wrapper">

			<div class="content" id="content-two-columns">

				<div id="main-wrapper">
					<div id="main">
						<!-- 현재 선택된 카테고리 -->
						<h3>
						<c:choose>
							<c:when test="${category != null}">${category.categoryFullName}</c:when>
							<c:otherwise>전체상품목록</c:otherwise>
						</c:choose>
						<c:if test="${session != null}">
							<button type="button" class="write" id="btnProductForm"><span>쓰기</span></button>
						</c:if>
						</h3>
						<c:if test="${productList != null}">
						<c:forEach var="product" items="${productList}">
						<div class="mini-post">
							<div class="mini-post-body">
								<table class="product_list_table">
									<tr>
										<td>
											<a href="/products/view/${product.productId}.do?productCategoryId=${product.productCategoryId}">
												<img src="/UpLoad/${product.productThumbnailName}" width="180" alt="" class="bordered" />
											</a>
										</td>
									</tr>
									<tr>
										<th>${product.productName}</th>
									</tr>
									<tr>
										<td>사이즈 : ${product.productSize}</td>
									</tr>
									<tr>
										<td>제조일자 : ${product.productRegistrationDay}</td>
									</tr>
								</table>
							</div>
						</div>
						</c:forEach>
						</c:if>
						<c:if test="${endPageNumber-1>0}">
						<div  id="pagination">
							<ul>
								<li class="previous-off"><c:if test="${previousStatus == true}"><a href="/products.do?pageNumber=${startPageNumber-1}"></c:if>«이전<c:if test="${previousStatus == true}"></a></c:if></li>
								<!-- <li class="active">1</li>
								<li><a href="#">2</a></li>
								<li><a href="#">3</a></li>
								<li><a href="#">4</a></li>
								<li><a href="#">5</a></li>
								<li><a href="#">6</a></li>
								<li><a href="#">7</a></li> -->
								<c:forEach begin="0" end="${endPageNumber-1}" step="1" var="indexVar">
									<li><a href="/products.do?pageNumber=${startPageNumber+indexVar}">${startPageNumber+indexVar}</a></li>
								</c:forEach>
								<li class="next-off"><c:if test="${nextStatus == true}"><a href="/products.do?pageNumber=${endPageNumber+1}"></c:if>다음 »<c:if test="${nextStatus == true}"></a></c:if></li>
							</ul>
						</div>	
						</c:if>
					</div>
				</div>
			</div>

			<div id="sidebar-wrapper">
				<div id="sidebar">
					<!-- 카테고리 box 시작 -->
					<%@ include file="/WEB-INF/category.jsp"%>
					<!-- 카테고리 box 끝 -->

					<!-- <div class="box">
							<div class="box-title">Resources</div>

							<div class="box-content">

								<ul class="nice-list">
									<li><a href="http://templates.arcsin.se/">Arcsin Web Templates</a></li>
									<li><a href="http://www.google.com/">Google</a> - Web Search</li>
									<li><a href="http://www.w3schools.com/">W3Schools</a> - Online Web Tutorials</li>
									<li><a href="http://www.wordpress.org/">WordPress</a> - Blog Platform</li>

									<li><a href="http://cakephp.org/">CakePHP</a> - PHP Framework</li>
								</ul>
							</div>
						</div> -->

					<div class="box nobborder">

						<div class="box-title">About</div>

						<div class="box-content">
							<p>뭔가 About 설명이 들어가야할 영역</p>
						</div>

					</div>

				</div>
			</div>

			<div class="clearer">&nbsp;</div>

		</div>

	</div>
	</div>

	<!-- bottom 시작 -->
	<%@ include file="/WEB-INF/bottom.jsp"%>
	<!-- bottom 끝 -->

</body>
</html>